From 241d97bbf952794ba3c5c891f7f37fc5c49cccd3 Mon Sep 17 00:00:00 2001 From: NiLSPACE Date: Fri, 4 Oct 2019 15:50:47 +0200 Subject: Fixed crash in hopper while pulling items from blockentity above itself (#4412) --- src/BlockEntities/HopperEntity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BlockEntities/HopperEntity.cpp b/src/BlockEntities/HopperEntity.cpp index ea1e12008..a0705e996 100644 --- a/src/BlockEntities/HopperEntity.cpp +++ b/src/BlockEntities/HopperEntity.cpp @@ -148,7 +148,7 @@ bool cHopperEntity::MoveItemsIn(cChunk & a_Chunk, Int64 a_CurrentTick) // Try moving an item in: bool res = false; - switch (a_Chunk.GetBlock(GetRelPos())) + switch (a_Chunk.GetBlock(GetRelPos().addedY(1))) { case E_BLOCK_TRAPPED_CHEST: case E_BLOCK_CHEST: @@ -168,7 +168,7 @@ bool cHopperEntity::MoveItemsIn(cChunk & a_Chunk, Int64 a_CurrentTick) case E_BLOCK_DROPPER: case E_BLOCK_HOPPER: { - res = MoveItemsFromGrid(*static_cast(a_Chunk.GetBlockEntity(GetRelPos().addedY(1)))); + res = MoveItemsFromGrid(*static_cast(a_Chunk.GetBlockEntity(this->GetPos().addedY(1)))); break; } } -- cgit v1.2.3